home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 25 / q25.d81 / t.megabasic 1 < prev    next >
Text File  |  2022-08-28  |  12KB  |  312 lines

  1.  
  2.                              M E G a B a s i c
  3.  
  4.                                by e. g. bell
  5.                                       
  6.     BASIC programmers have a VERY powerful computer in the Commodore 128.
  7. There are a lot of tools to make life for the programmer easier.  People who
  8. cut their teeth on the C64 didn't have all the sprite, music, and graphic
  9. commands to take the sweat and pain out of development of their
  10. masterpieces.  Of course, this kind of problem has never proven much
  11. resistance for the people who program the C64 and C128.  When they need
  12. tools they write them, and there have been a LOT of powerful utilities
  13. developed over the years.  You have to wonder how many of the power features
  14. of the C128 came as the direct result of these programs.
  15.  
  16.     Many of the support magazines that rose and fell over the years
  17. published these gems, and as time went on, our toolboxes became quite full.
  18. But there never seem to be enough tools.  Even now development continues on
  19. our 8 bit machines.  People are wringing more powerful, more wonderful
  20. things from them.  There are always tasks that can be made easier, smaller,
  21. faster, or just more fun.
  22.  
  23.     The variety of tools developed, I believe, has been largely because
  24. programmers needed them.  Each programmer has a different style, and thus
  25. often different needs, or different perspectives on what it takes to meet
  26. these needs properly.  Some utilties have been around for years.  Some have
  27. cropped up with new spins on old capabilities.  Every once in awhile, you
  28. get some that you haven't seen before.  I believe you will find MEGaBasic to
  29. be a nice mix of these.  Some new, some old, most with a new twist.  I'm
  30. positive you will find this collection of utilities a valuable addition to
  31. your toolbox.
  32.  
  33. *** MEGaBasic 2.16 Command Set
  34.  
  35. help                change                 dlist
  36. find                merge                  quit
  37. read                resave                 old
  38. move                combine                lsave
  39. start               compare                control
  40.  
  41. *** Getting Started
  42.  
  43.     MEGaBasic lives in memory at $DC00/57344 in RAM-1 as a 'permanant' home.
  44. To install the utility, there are just 2 simple steps:
  45.  
  46.      bload "megabasic 2.16",b1,u<drive number>
  47.      bank 1 : sys 57344 : clr
  48.  
  49. The CLR command is NECESSARY to make doubly sure that MEGaBasic is safe from
  50. assault by BASIC program variables.
  51.  
  52.     When you issue the BANK 1:SYS 57344 :clr commands, the controlling
  53. portion of MEGaBasic is moved down to address 4864.  This is the focal point
  54. of all the available commands.  When you request a function, that function
  55. is moved down into a staging area and does its job.  This happens every time
  56. you issue a command.
  57.  
  58.     MEGaBasic protects itself from BASIC variables.  Thus you don't have to
  59. worry about your BASIC program clobbering MEGaBasic.  The code living at
  60. 4864 can be disabled by typing the QUIT command.  But MEGaBasic is rather
  61. hardy.  It is still in memory, and can be reactivated with the 'bank 1:sys
  62. 57344 command'.  It is so hardy, in fact, it will even survive a trip into
  63. 64 mode and back to 128 mode.
  64.  
  65. *** Conventions
  66.  
  67.     As you read this document, you will be shown syntax for those commands
  68. that must be supplied information in order to work.  When you see the
  69. syntax, everything enclosed in  <>  characters is an optional part of the
  70. command.  For any command syntax displayed in [] characters, this indicates
  71. that there are two possible forms of the argument, one or the other may be
  72. used, but not both.
  73.  
  74.  
  75.     For the most part, the parameters you will see are:
  76.  
  77. <,u#>         This means you can specify the drive which the command or
  78. function affects.  Note that the syntax is the same as for the standard
  79. BASIC 7.0 disk commands like DSAVE, BLOAD, COLLECT, etc.
  80.  
  81. <,from-line> This entry determines where in the program the specified
  82. operation will begin.  The 'from-line' is the first line of the program that
  83. will be affected by the FIND, CHANGE, DLIST, MERGE, etc.  The default is the
  84. first line of the program or file.
  85.  
  86. <,to-line>   This entry determines where in the program the specified
  87. operation will end.  The 'to-line' is the last line of the program that will
  88. be affected by the FIND, CHANGE, DLIST, MERGE, etc.  The default is the last
  89. line of the program or file.
  90.  
  91. *Note*  The from-line in any of the commands that use that parameter MUST be
  92. preceded by a comma.  However, you can use a '-' between the 'from' and 'to'
  93. line entries instead of a comma if you wish.  For example, all of the
  94. following forms are correct:
  95.  
  96.     find @string@,100-500
  97. or  find @string@,100,500
  98.  
  99.     change @old@new@,100,500
  100. or  change @old@new@,100-500
  101.  
  102.     move,100,500,1000
  103. or  move,100-500,1000
  104. or  move,100-500-1000
  105.  
  106.     Also note that if you only specify the from-line, you must not enter the
  107. '-' as you would when listing a program, for example.  Use of the from-line
  108. only, without a to-line, will accomplish the desired effect of acting on
  109. lines from 'from-line' to the end of the file in memory.
  110.  
  111.     In addition, if you choose to use a <to-line>, you *must* use a <from-
  112. line>.
  113.  
  114.     For all but a few of the MEGaBasic commands, you can get a display of
  115. the syntax by typing just the command without any parameters.  For example,
  116. type CHANGE and press RETURN and the syntax for the CHANGE command will be
  117. displayed as a quick reminder of how to use the command.  Do the same thing
  118. with FIND, COMPARE, RESAVE, and most all of the commands.  The exceptions to
  119. this are OLD, HELP, and QUIT.
  120.  
  121.     MEGaBasic keeps its own record of the current drive for all of its
  122. commands.  The first time you install MEGaBasic, it records the last
  123. accessed disk unit if valid.  If not, it defaults to 8.  After that, that
  124. setting is used for the commands that involve a drive if you don't specify a
  125. drive.  Each time you specify a drive using the 'u#' argument, this setting
  126. is updated to that value.  Thus, the '<,U#> can frequently be omitted if you
  127. are using the same drive for all operations.
  128.  
  129. *** HELP
  130.  
  131.     HELP brings up the list of available commands.   In 80 column mode, you
  132. will get a 3 column display as above.  In 40 column mode the display is a
  133. single column.  Although MEGaBasic won't disturb a running BASIC program,
  134. you should disable it before you start your programs.  This will assure that
  135. the BASIC 7.0 HELP command is recognized as distinct from the MEGaBasic
  136. HELP command.
  137.  
  138. *** CHANGE
  139.  
  140.     CHANGE allows you to change strings from one thing to another in your
  141. programs.  This is a very handy utility.  When you want to change something
  142. throughout your program or in a certain range, this command assures that all
  143. instances are changed.
  144.  
  145.     The syntax for the CHANGE command is:
  146.  
  147.  change /old/new/ <,from-line><,to-line>
  148.  change @old@new@ <,from-line><,to-line>
  149.  change "old" <to> "new" <,from-line><,to-line>
  150.  
  151. Note that there are 3 different possible delimiters for the change command.
  152. The '/' and '@' delimiters function identically.  This means there are no
  153. characters that can't be found and changed.  These delimiters are used
  154. whenever the string you want to change is a BASIC keyword, or includes an
  155. embedded BASIC keyword.  For example, if you wanted to change PRINT to
  156. PRINT#3, you would use one of these delimiters.
  157.  
  158.  Ex:
  159.  change/print/print#3/
  160.  or change@print@print#3@
  161.  
  162. Note that all delimiters are the same within a command line.  You can't mix
  163. them.
  164.  
  165. The " delimiter is used when you want to change control characters or
  166. uppercase letters or strings.  Note that to CHANGE, the following lines are
  167. quite different, and are going to respond differently to attempts to change
  168. 'print' to something different.
  169.  
  170.  10 print 
  171.  20 rem print
  172.  30 print "print"
  173.  
  174. Assume you issue the command
  175.  
  176.  change /print/print#3,/
  177.  
  178. The program would be changed in the following way:
  179.  
  180.  10 print#3,
  181.  20 rem print
  182.  30 print#3,"print"
  183.  
  184. Assume you issue the command
  185.  
  186.  change "print" to "print#3"
  187.  
  188. Now the program would be changed as follows:
  189.  
  190.  10 print 
  191.  20 rem print#3
  192.  30 print "print#3"
  193.  
  194.     The difference lies in BASIC's tokenization of commands.  The BASIC
  195. command 'PRINT' is tokenized to a 1 character token by the BASIC interpreter
  196. built into your machine.  However, strings